      ##The spatial and temporal variables for the 1D model(spatial variable in the axial direction)

# from casadi import DM
import numpy as np

def spatialVariables_1D():
    # totalDepth      = 0.13   # in meters ('m')
    # axialNodes      = 14
    totalDepth      = 0.5
    axialNodes      = 26
    axialDistance   = totalDepth/(axialNodes-1)
    totalNodes      = axialNodes
    totalStates     = totalNodes
    dimenProcNoise  = totalStates
    numOfActuators  = 1
    interPoints     = 500

    return totalDepth, axialNodes, axialDistance, totalNodes, numOfActuators, interPoints
    



def temporalVariable():
    samplingTime   = 1*6*60
    samplingTimeInternal = 1*6*60
    #simulationTime = 7*6*4*60*60
    simulationTime = 15*24*60*60
    internalTimeSteps = int(samplingTime/samplingTimeInternal)
    totTimeSteps   = int(simulationTime/samplingTime)
    return samplingTime, samplingTimeInternal, internalTimeSteps, totTimeSteps



def temporalVariable_dataGen(final_time):
    samplingTime   = 2*60*60
    samplingTimeInternal = 1*6*60
    #simulationTime = *6*4*60*60
    simulationTime = final_time
    internalTimeSteps = int(samplingTime/samplingTimeInternal)
    totTimeSteps   = int(simulationTime/samplingTime)
    return samplingTime, samplingTimeInternal, internalTimeSteps, totTimeSteps



def CMatrixAllMeasurements(totalStates):
    CMatrixAll = np.eye(totalStates)
    return CMatrixAll



def loamySoil():
    soilPars={}
    soilPars['thetaR'] = 0.065  # 0.078
    soilPars['thetaS'] = 0.41  # 0.43
    soilPars['alpha']  = 7.5  # 3.6
    soilPars['n']      = 1.89  # 1.56
    soilPars['m']      = 1-1/soilPars['n']
    soilPars['Ks']     = 4.4208e-2/3600  # 0.00000288889
    soilPars['neta']   = 0.5
    soilPars['Ss']     = 0.00001

    return soilPars


def generatingCoordinates_1D(axialNodes):
    #Coordinates are used to identify each node present in the mesh
    coordinates=[]
    for k in range(axialNodes):
        y=[0,0,k]
        coordinates.append(y)            
    return coordinates